package gttp.nspa.client.adm.ui;

import com.google.gwt.i18n.client.NumberFormat;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.form.NumberPropertyEditor.IntegerPropertyEditor;
import com.sencha.gxt.widget.core.client.form.SpinnerField;

public class MassaForm extends ProductForm {

    protected SpinnerField<Integer> sfDuration;

    public MassaForm() {
        super("Massa Service", 500, 75);
    }

    protected void createFormFields(VerticalLayoutContainer con) {
        super.createFormFields(con);

        sfDuration = new SpinnerField<Integer>(new IntegerPropertyEditor());
        sfDuration.getPropertyEditor().setFormat(NumberFormat.getFormat(",### 'p'h'ú't"));
        sfDuration.setIncrement(new Integer(15));
        sfDuration.setMinValue(new Integer(30));
        sfDuration.setMaxValue(new Integer(360));
        sfDuration.setValue(new Integer(60));
        sfDuration.setAllowNegative(false);

        FieldLabel fl = new FieldLabel(sfDuration, "Thời lượng");
        fl.setLabelWidth(labelWidth);
        con.add(fl, new VerticalLayoutData(1, -1));
    }
}
